//package View.Updata;
//
//import Hander.Updata.UpdataPersonnelViewHander;
//import View.LeaderView;
//import entity.Personnel;
//import service.PersonnelService;
//import service.PersonnelServiceImpl;
//
//import javax.swing.*;
//import java.awt.*;
//import java.sql.Date;
//
//public class UpdataProjectView2 extends JDialog {
//    private String tablesName;
//    SpringLayout springLayout=new SpringLayout();//弹簧布局
//    JPanel jPanel=new JPanel(springLayout);
//    //输入添加：
//    // Personnel类属性的JLabel和JTextField
//    JLabel personnelIDLabel = new JLabel("PersonnelID:", JLabel.RIGHT);
//    JTextField personnelIDTextField = new JTextField();
//
//    JLabel fullNameLabel = new JLabel("FullName:", JLabel.RIGHT);
//    JTextField fullNameTextField = new JTextField();
//
//    JLabel genderLabel = new JLabel("Gender:", JLabel.RIGHT);
//    JTextField genderTextField = new JTextField();
//
//    JLabel ethnicityLabel = new JLabel("Ethnicity:", JLabel.RIGHT);
//    JTextField ethnicityTextField = new JTextField();
//
//    JLabel departmentIDLabel = new JLabel("DepartmentID:", JLabel.RIGHT);
//    JTextField departmentIDTextField = new JTextField();
//
//    JLabel titleLabel = new JLabel("Title:", JLabel.RIGHT);
//    JTextField titleTextField = new JTextField();
//
//    JLabel birthDateLabel = new JLabel("BirthDate:", JLabel.RIGHT);
//    JTextField birthDateTextField = new JTextField();
//
//    JLabel educationLevelLabel = new JLabel("EducationLevel:", JLabel.RIGHT);
//    JTextField educationLevelTextField = new JTextField();
//
//    JLabel baseSalaryLabel = new JLabel("BaseSalary:", JLabel.RIGHT);
//    JTextField baseSalaryTextField = new JTextField();
//
//    JLabel positionSalaryLabel = new JLabel("PositionSalary:", JLabel.RIGHT);
//    JTextField positionSalaryTextField = new JTextField();
//
//    JLabel positionAllowanceLabel = new JLabel("PositionAllowance:", JLabel.RIGHT);
//    JTextField positionAllowanceTextField = new JTextField();
//
//    JLabel hireDateLabel = new JLabel("HireDate:", JLabel.RIGHT);
//    JTextField hireDateTextField = new JTextField();
//    public void Layout(){
//        SpringLayout.Constraints personnelIDLabelC =springLayout.getConstraints(personnelIDLabel);
//        personnelIDLabelC.setY(Spring.constant(50));
//        personnelIDLabelC.setX(Spring.constant(150));
//
//        springLayout.putConstraint(SpringLayout.NORTH,personnelIDTextField,0,SpringLayout.NORTH,personnelIDLabel);
//        springLayout.putConstraint(SpringLayout.WEST,personnelIDTextField,20,SpringLayout.EAST,personnelIDLabel);
//
//        springLayout.putConstraint(SpringLayout.EAST,fullNameLabel,0,SpringLayout.EAST,personnelIDLabel);
//        springLayout.putConstraint(SpringLayout.NORTH,fullNameLabel,20,SpringLayout.SOUTH,personnelIDLabel);
//
//
//        springLayout.putConstraint(SpringLayout.NORTH,fullNameTextField,0,SpringLayout.NORTH,fullNameLabel);
//        springLayout.putConstraint(SpringLayout.WEST,fullNameTextField,20,SpringLayout.EAST,fullNameLabel);
//
//        springLayout.putConstraint(SpringLayout.EAST,genderLabel,0,SpringLayout.EAST,fullNameLabel);
//        springLayout.putConstraint(SpringLayout.NORTH,genderLabel,20,SpringLayout.SOUTH,fullNameLabel);
//
//        springLayout.putConstraint(SpringLayout.NORTH,genderTextField,0,SpringLayout.NORTH,genderLabel);
//        springLayout.putConstraint(SpringLayout.WEST,genderTextField,20,SpringLayout.EAST,genderLabel);
//
//        springLayout.putConstraint(SpringLayout.EAST,ethnicityLabel,0,SpringLayout.EAST,genderLabel);
//        springLayout.putConstraint(SpringLayout.NORTH,ethnicityLabel,20,SpringLayout.SOUTH,genderLabel);
//
//        springLayout.putConstraint(SpringLayout.NORTH,ethnicityTextField,0,SpringLayout.NORTH,ethnicityLabel);
//        springLayout.putConstraint(SpringLayout.WEST,ethnicityTextField,20,SpringLayout.EAST,ethnicityLabel);
//
//        springLayout.putConstraint(SpringLayout.EAST,departmentIDLabel,0,SpringLayout.EAST,ethnicityLabel);
//        springLayout.putConstraint(SpringLayout.NORTH,departmentIDLabel,20,SpringLayout.SOUTH,ethnicityLabel);
//
//        springLayout.putConstraint(SpringLayout.NORTH,departmentIDTextField,0,SpringLayout.NORTH,departmentIDLabel);
//        springLayout.putConstraint(SpringLayout.WEST,departmentIDTextField,20,SpringLayout.EAST,departmentIDLabel);
//
//        springLayout.putConstraint(SpringLayout.EAST,titleLabel,0,SpringLayout.EAST,departmentIDLabel);
//        springLayout.putConstraint(SpringLayout.NORTH,titleLabel,20,SpringLayout.SOUTH,departmentIDLabel);
//
//        springLayout.putConstraint(SpringLayout.NORTH,titleTextField,0,SpringLayout.NORTH,titleLabel);
//        springLayout.putConstraint(SpringLayout.WEST,titleTextField,20,SpringLayout.EAST,titleLabel);
//
//        springLayout.putConstraint(SpringLayout.EAST,birthDateLabel,0,SpringLayout.EAST,titleLabel);
//        springLayout.putConstraint(SpringLayout.NORTH,birthDateLabel,20,SpringLayout.SOUTH,titleLabel);
//
//        springLayout.putConstraint(SpringLayout.NORTH,birthDateTextField,0,SpringLayout.NORTH,birthDateLabel);
//        springLayout.putConstraint(SpringLayout.WEST,birthDateTextField,20,SpringLayout.EAST,birthDateLabel);
//
//        springLayout.putConstraint(SpringLayout.EAST,educationLevelLabel,0,SpringLayout.EAST,birthDateLabel);
//        springLayout.putConstraint(SpringLayout.NORTH,educationLevelLabel,20,SpringLayout.SOUTH,birthDateLabel);
//
//        springLayout.putConstraint(SpringLayout.NORTH,educationLevelTextField,0,SpringLayout.NORTH,educationLevelLabel);
//        springLayout.putConstraint(SpringLayout.WEST,educationLevelTextField,20,SpringLayout.EAST,educationLevelLabel);
//
//        springLayout.putConstraint(SpringLayout.EAST,baseSalaryLabel,0,SpringLayout.EAST,educationLevelLabel);
//        springLayout.putConstraint(SpringLayout.NORTH,baseSalaryLabel,20,SpringLayout.SOUTH,educationLevelLabel);
//
//        springLayout.putConstraint(SpringLayout.NORTH,baseSalaryTextField,0,SpringLayout.NORTH,baseSalaryLabel);
//        springLayout.putConstraint(SpringLayout.WEST,baseSalaryTextField,20,SpringLayout.EAST,baseSalaryLabel);
//
//        springLayout.putConstraint(SpringLayout.EAST,positionSalaryLabel,0,SpringLayout.EAST,baseSalaryLabel);
//        springLayout.putConstraint(SpringLayout.NORTH,positionSalaryLabel,20,SpringLayout.SOUTH,baseSalaryLabel);
//
//        springLayout.putConstraint(SpringLayout.NORTH,positionSalaryTextField,0,SpringLayout.NORTH,positionSalaryLabel);
//        springLayout.putConstraint(SpringLayout.WEST,positionSalaryTextField,20,SpringLayout.EAST,positionSalaryLabel);
//
//        springLayout.putConstraint(SpringLayout.EAST,positionAllowanceLabel,0,SpringLayout.EAST,positionSalaryLabel);
//        springLayout.putConstraint(SpringLayout.NORTH,positionAllowanceLabel,20,SpringLayout.SOUTH,positionSalaryLabel);
//
//
//        springLayout.putConstraint(SpringLayout.NORTH,positionAllowanceTextField,0,SpringLayout.NORTH,positionAllowanceLabel);
//        springLayout.putConstraint(SpringLayout.WEST,positionAllowanceTextField,20,SpringLayout.EAST,positionAllowanceLabel);
//
//        springLayout.putConstraint(SpringLayout.EAST,hireDateLabel,0,SpringLayout.EAST,positionAllowanceLabel);
//        springLayout.putConstraint(SpringLayout.NORTH,hireDateLabel,20,SpringLayout.SOUTH,positionAllowanceLabel);
//
//        springLayout.putConstraint(SpringLayout.NORTH,hireDateTextField,0,SpringLayout.NORTH,hireDateLabel);
//        springLayout.putConstraint(SpringLayout.WEST,hireDateTextField,20,SpringLayout.EAST,hireDateLabel);
//
//        springLayout.putConstraint(SpringLayout.EAST,updataBtn,0,SpringLayout.EAST,hireDateLabel);
//        springLayout.putConstraint(SpringLayout.NORTH,updataBtn,20,SpringLayout.SOUTH,hireDateLabel);
//
//    }
//
//    JButton updataBtn=new JButton("修改");
//    UpdataPersonnelViewHander updataPersonnelViewHander;
//
//    public UpdataProjectView2(LeaderView leaderView, int selectedStudentId){
//
//        super(leaderView,"修改信息",true);
//
////        setTablesName(tableName);
//        updataPersonnelViewHander=new UpdataPersonnelViewHander(this,leaderView );
//
//        //
//        //数据查询对应的记录并回显
//        PersonnelService personnelService=new PersonnelServiceImpl();
//        Personnel personnel=personnelService.getById(selectedStudentId,"Personnel");
//
//        // Personnel类属性的JLabel和JTextField
//        personnelIDTextField.setPreferredSize(new Dimension(200, 20));
//
//        fullNameTextField.setPreferredSize(new Dimension(200, 20));
//
//        genderTextField.setPreferredSize(new Dimension(200, 20));
//
//        ethnicityTextField.setPreferredSize(new Dimension(200, 20));
//
//        departmentIDTextField.setPreferredSize(new Dimension(200, 20));
//
//        titleTextField.setPreferredSize(new Dimension(200, 20));
//
//        birthDateTextField.setPreferredSize(new Dimension(200, 20));
//
//        educationLevelTextField.setPreferredSize(new Dimension(200, 20));
//
//        baseSalaryTextField.setPreferredSize(new Dimension(200, 20));
//
//        positionSalaryTextField.setPreferredSize(new Dimension(200, 20));
//
//        positionAllowanceTextField.setPreferredSize(new Dimension(200, 20));
//
//        hireDateTextField.setPreferredSize(new Dimension(200, 20));
//
//        Layout();
//
//        jPanel.add(personnelIDLabel);
//        jPanel.add(personnelIDTextField);
//        personnelIDTextField.setText(personnel.getPersonnelID()+"");
//
//        jPanel.add(fullNameLabel);
//        jPanel.add(fullNameTextField);
//        fullNameTextField.setText(personnel.getFullName()+"");
//
//        jPanel.add(genderLabel);
//        jPanel.add(genderTextField);
//        genderTextField.setText(personnel.getGender()+"");
//
//        jPanel.add(ethnicityLabel);
//        jPanel.add(ethnicityTextField);
//        ethnicityTextField.setText(personnel.getEthnicity()+"");
//
//        jPanel.add(departmentIDLabel);
//        jPanel.add(departmentIDTextField);
//        departmentIDTextField.setText(personnel.getDepartmentID()+"");
//
//        jPanel.add(titleLabel);
//        jPanel.add(titleTextField);
//        titleTextField.setText(personnel.getTitle()+"");
//
//        jPanel.add(birthDateLabel);
//        jPanel.add(birthDateTextField);
//        birthDateTextField.setText(personnel.getBirthDate()+"");
//
//        jPanel.add(educationLevelLabel);
//        jPanel.add(educationLevelTextField);
//        educationLevelTextField.setText(personnel.getEducationLevel()+"");
//
//        jPanel.add(baseSalaryLabel);
//        jPanel.add(baseSalaryTextField);
//        baseSalaryTextField.setText(personnel.getBaseSalary()+"");
//
//        jPanel.add(positionSalaryLabel);
//        jPanel.add(positionSalaryTextField);
//        positionSalaryTextField.setText(personnel.getPositionSalary()+"");
//
//        jPanel.add(positionAllowanceLabel);
//        jPanel.add(positionAllowanceTextField);
//        positionAllowanceTextField.setText(personnel.getPositionAllowance()+"");
//
//        jPanel.add(hireDateLabel);
//        jPanel.add(hireDateTextField);
//        hireDateTextField.setText(personnel.getHireDate()+"");
//
//        updataBtn.addActionListener(updataPersonnelViewHander);
//        jPanel.add(updataBtn);
//        Container contentPane=  getContentPane();
//        contentPane.add(jPanel);
//
//        setSize(600,600);
//        setLocationRelativeTo(null);
//        setDefaultCloseOperation(DISPOSE_ON_CLOSE);
//        setResizable(false);
//        setVisible(true);
//    }
//
//
//    public Personnel buildAchievement(){
//        Personnel personnel=new Personnel();
//        personnel.setPersonnelID(Integer.valueOf(personnelIDTextField.getText()));
//        personnel.setFullName(String.valueOf(fullNameTextField.getText()));
//        personnel.setGender(String.valueOf(genderTextField.getText()));
//        personnel.setEthnicity(String.valueOf(ethnicityTextField.getText()));
//        personnel.setDepartmentID(Integer.valueOf(departmentIDTextField.getText()));
//        personnel.setTitle(String.valueOf(titleTextField.getText()));
//        personnel.setBirthDate(Date.valueOf(birthDateTextField.getText()));
//        personnel.setEducationLevel(String.valueOf(educationLevelTextField.getText()));
//        personnel.setBaseSalary(Double.valueOf(baseSalaryTextField.getText()));
//        personnel.setPositionSalary(Double.valueOf(positionSalaryTextField.getText()));
//        personnel.setPositionAllowance(Double.valueOf(positionAllowanceTextField.getText()));
//        personnel.setHireDate(Date.valueOf(hireDateTextField.getText()));
//        return personnel;
//    }
//    public String getTablesName() {
//        return tablesName;
//    }
//
//    public void setTablesName(String tablesName) {
//        this.tablesName = tablesName;
//    }
//
//}
